/*
void func(MyType* ptr);       // 1
void func(unsigned val);      // 2

MyType z;
func(&z); // good
func(0);  // error, ambiguity


need to call second function (void func(unsigned))
You can only change functions prototypes, but not change unsigned to int

*/

#include<iostream>
using namespace std;

class MyType {
	int m;
};


struct Str {
	int x;
};

Str f(int (x) ) {
	x = 1;
}

template <class T>
void func_ptr(T* ptr) {
	cout << "calling template function func_ptr" << endl;
}

//template specialization:
template <>
void func_ptr<MyType>(MyType* ptr) {
	cout << "calling func_ptr with MyType*" << endl;
}

void func_test(int* const & ref) {
	cout << "MyType ref = " << ref << endl;
}

void func_ptr(unsigned const& val) {
	cout << "func_ptr unsigned = " << val << endl;
}

void func(unsigned val=1) {
	cout << "int value = " << val << endl;
}

void func(char val) {
	cout << "char value = " << val << endl;
}

void func(double val) {
	cout << "double value = " << val << endl;

}
int main(void) {
	MyType z;
	func_ptr(&z);
	//func_test(&z);
	//func(1);
	func_ptr(0);
	
	func_ptr<MyType> (&z);
	return 0;
}
